﻿@using Models;
@model List<player>
@{
    ViewBag.Title = "选手排行榜";
    Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml";
}
<link href="~/Areas/Admin/HTML/css/screen.css?v=(@DateTime.Now.ToString("yyyyMMddHHmmssffff"))" rel="stylesheet" />
<div class="screen-content">
    <div class="screen-header">
        <h1 style="line-height:100px;letter-spacing:5px;"><img style="margin-right: 10px;" src="~/Areas/Admin/HTML/screenimgs/icon-player.png" />选手排行榜</h1>
        <img class="qr-code" src="/Areas/Admin/HTML/screenimgs/QRcode.jpg?v=1" onclick="showImg(this)" />
    </div>
    <div class="expert-out-content">
        <div class="expert-content-bar"></div>
        <div class="expert-content">
            <ul class="rank-list">
                <li class="rank-title">
                    <div class="player-sort">排名</div>
                    <div class="player-text">选手</div>
                    <div class="player-score">得分</div>
                </li>
            </ul>
            <ul class="rank-list" id="page-ui">
                @Html.Partial("_PlayerRank", Model)
            </ul>
        </div>
    </div>
</div>
<script>
    $(function () {
        setInterval(function () {
            $.get('/admin/screen/playerrank', null, function (res) {
                if (res.length > 0) {
                    $("#page-ui").empty().append(res);
                }
                else {
                    alert("数据请求失败！")
                }
            });
        }, 3000);
    });

    function showImg(target) {
        var img = $(target).attr("src");
        layer.open({
            type: 1,
            offset: '20px',
            title: false,
            skin: 'layui-layer-demo', //样式类名
            closeBtn: 1, //不显示关闭按钮
            shadeClose: true, //开启遮罩关闭
            area: ['700px', '700px'],
            content: '<img src="' + img + '" width="100%"/>'
        });
    }
</script>